group_num = 40

with open('src/simulator/simulator/quadrotor_simulator/config/group_1.11','r') as f:
    group_lines=[]
    for line in f.readlines():
        group_lines.append(line)
         
with open(f'src/simulator/simulator/quadrotor_simulator/config/drone_group_1.11_{group_num}','w') as f:
  row_in_all = 0
  id_in_all = 0
  for group_id in range(group_num):
    for line in group_lines:
      if 'drone_0' in line:
        f.write(line.replace('drone_0', f'drone_{str(group_id)}'))
      elif 'uav0' in line:
        f.write(line.replace('uav0', f'uav{str(group_id)}'))
      elif 'drone0' in line:
        f.write(line.replace('drone0', f'drone{str(group_id)}'))
      else:
        f.write(line)
    f.write('\n')